# Reference: <https://postmarketos.org/devicepkg>
pkgname=device-lg-bullhead
pkgdesc="Google Nexus 5X"
pkgver=3
pkgrel=7
url="https://postmarketos.org"
license="MIT"
arch="aarch64"
depends="
	mkbootimg
	msm-fb-refresher
	postmarketos-base
"
makedepends="devicepkg-dev"
subpackages="
	$pkgname-kernel-downstream:kernel_downstream
	$pkgname-kernel-mainline:kernel_mainline
	$pkgname-nonfree-firmware:nonfree_firmware
"
source="deviceinfo"
options="!check !archcheck"

build() {
	devicepkg_build $startdir $pkgname
}

kernel_downstream() {
	pkgdesc="Downstream kernel"
	depends="linux-lg-bullhead"
	devicepkg_subpackage_kernel $startdir $pkgname $subpkgname
}

kernel_mainline() {
	pkgdesc="Close to mainline kernel (only basic hardware support)"
	depends="linux-postmarketos-qcom-msm8994"
	devicepkg_subpackage_kernel $startdir $pkgname $subpkgname
}

nonfree_firmware() {
	pkgdesc="Proprietary WiFi, Modem, GPU and sensors firmware"
	depends="firmware-lg-bullhead"
	mkdir "$subpkgdir"
}

package() {
	devicepkg_package $startdir $pkgname
}

sha512sums="
1a8413bc2c1a8be41c75cdbb7c0137783ce435ea236501d38cfe1fadaf6107dc5514747b1d37d0f3a303f243ef8b6297ac2666a7d517e3ee2361a3d6dcc13b42  deviceinfo
"
